<?php
/**
 * Routes configuration
 *
 * In this file, you set up routes to your controllers and their actions.
 * Routes are very important mechanism that allows you to freely connect
 * different urls to chosen controllers and their actions (functions).
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.app.config
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
/**
 * Here, we are connecting '/' (base path) to controller called 'Pages',
 * its action called 'display', and we pass a param to select the view file
 * to use (in this case, /app/views/pages/home.ctp)...
 */
	Router::connect('/', array('controller' => 'products', 'action' => 'homepage'));
	Router::connect('/deals/product_deals/:product_id', array('controller' => 'deals', 'action' => 'index'),
					array(
					'pass' => array('product_id'),
					'product_id' => '[0-9]+'
					));
	Router::connect('/products/add', array('controller' => 'products', 'action' => 'add'));
	Router::connect('/products/edit/:id', array('controller' => 'products', 'action' => 'edit'), 
					array(
					'pass'=>array('id'),
					'id' => '[0-9]+'
					));
	Router::connect('/products/delete/:id', array('controller' => 'products', 'action' => 'delete'), 
					array(
					'pass'=>array('type','id'),
					'id' => '[0-9]+'
					));
	Router::connect('/products/view/:id', array('controller' => 'products', 'action' => 'view'), 
					array(
					'pass'=>array('id'),
					'id' => '[0-9]+'
					));
	Router::connect('/deals/add', array('controller' => 'deals', 'action' => 'add'));
	Router::connect('/comment/add',array('controller'=>'comments','action'=>'add'));
	Router::connect('/ibless/map',array('controller'=>'products','action'=>'map'));
	Router::connect('/testimonies', array('controller' => 'products', 'action' => 'testimonies'));
/**
 * ...and connect the rest of 'Pages' controller's urls.
 */
	//Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
	Router::connect('/about', array('controller' => 'pages', 'action' => 'about'));
	Router::connect('/tnc', array('controller' => 'pages', 'action' => 'tnc'));
	
	/**
 * ...and connect the 'static' pages
 */
	
// add in default routing for admin
Router::connect('/admin', array('prefix'=>'admin', 'controller' => 'users', 'action' => 'login','admin'=>0));
Router::parseExtensions('rss');
